package com.lh.controller;


import com.lh.base.ResResult;
import com.lh.pojo.SysRole;
import com.lh.service.SysRoleService;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 角色表 前端控制器
 * </p>
 *
 * @author lh
 * @since 2021-03-02
 */
@RestController
@RequestMapping("/sys-role")
public class SysRoleController {

    @Autowired
    private SysRoleService sysRoleServiceImpl;

    @RequiresPermissions("sys:role:view")
    @GetMapping("/getAllRole")
    @ResponseBody
    @ApiOperation(value = "获取所有角色", notes = "获取所有角色")
    public ResResult getAllRole() {
        List<SysRole> list = sysRoleServiceImpl.list();
        return ResResult.success(list);
    }

}

